<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/waywardyux/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/waywardyux/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/waywardyux/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/waywardyux/images/logo.svg" color="#222">

<link rel="stylesheet" href="/waywardyux/css/main.css">


<link rel="stylesheet" href="/waywardyux/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"waywardyux.gitee.io","root":"/waywardyux/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="个人博客之路26岁了才开始写博客，不算早，也应该来得及  平时有记笔记的习惯，但是都零零散散，回想起来了就去翻一翻，和别人交流起来最多话是 “这这这，我好像有接触过，我有点印象”，终究没有形成积累。时光匆匆，我竟没有找到过去的影子。  方案及平台github pagehexohexo主题: hexo-theme-nextnodejs: 12.18.3npm: 6.14.6安装包地址:https:&#x2F;">
<meta property="og:type" content="article">
<meta property="og:title" content="blog 计划第一步: hexo + github page 搭建">
<meta property="og:url" content="https://waywardyux.gitee.io/2021/03/20/blog-%E8%AE%A1%E5%88%92%E7%AC%AC%E4%B8%80%E6%AD%A5-hexo-github-page-%E6%90%AD%E5%BB%BA/index.html">
<meta property="og:site_name" content="赶路贝壳">
<meta property="og:description" content="个人博客之路26岁了才开始写博客，不算早，也应该来得及  平时有记笔记的习惯，但是都零零散散，回想起来了就去翻一翻，和别人交流起来最多话是 “这这这，我好像有接触过，我有点印象”，终究没有形成积累。时光匆匆，我竟没有找到过去的影子。  方案及平台github pagehexohexo主题: hexo-theme-nextnodejs: 12.18.3npm: 6.14.6安装包地址:https:&#x2F;">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-03-20T11:36:28.000Z">
<meta property="article:modified_time" content="2021-12-23T05:04:19.008Z">
<meta property="article:author" content="yux">
<meta property="article:tag" content="hexo">
<meta property="article:tag" content="环境搭建">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://waywardyux.gitee.io/2021/03/20/blog-%E8%AE%A1%E5%88%92%E7%AC%AC%E4%B8%80%E6%AD%A5-hexo-github-page-%E6%90%AD%E5%BB%BA/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>blog 计划第一步: hexo + github page 搭建 | 赶路贝壳</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/waywardyux/atom.xml" title="赶路贝壳" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/waywardyux/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">赶路贝壳</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">想点好活儿整整</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/waywardyux/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/waywardyux/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/waywardyux/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签<span class="badge">3</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/waywardyux/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类<span class="badge">4</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/waywardyux/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档<span class="badge">4</span></a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://waywardyux.gitee.io/2021/03/20/blog-%E8%AE%A1%E5%88%92%E7%AC%AC%E4%B8%80%E6%AD%A5-hexo-github-page-%E6%90%AD%E5%BB%BA/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/waywardyux/images/head.jpg">
      <meta itemprop="name" content="yux">
      <meta itemprop="description" content="虚假快乐小牛马">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="赶路贝壳">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          blog 计划第一步: hexo + github page 搭建
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-03-20 19:36:28" itemprop="dateCreated datePublished" datetime="2021-03-20T19:36:28+08:00">2021-03-20</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-12-23 13:04:19" itemprop="dateModified" datetime="2021-12-23T13:04:19+08:00">2021-12-23</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/waywardyux/categories/%E6%90%AC%E7%A0%96%E4%B9%8B%E8%B7%AF/" itemprop="url" rel="index"><span itemprop="name">搬砖之路</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/waywardyux/categories/%E6%90%AC%E7%A0%96%E4%B9%8B%E8%B7%AF/hexo/" itemprop="url" rel="index"><span itemprop="name">hexo</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="个人博客之路"><a href="#个人博客之路" class="headerlink" title="个人博客之路"></a>个人博客之路</h1><p>26岁了才开始写博客，不算早，也应该来得及</p>
<blockquote>
<p>平时有记笔记的习惯，但是都零零散散，回想起来了就去翻一翻，和别人交流起来最多话是 “这这这，我好像有接触过，我有点印象”，终究没有形成积累。时光匆匆，我竟没有找到过去的影子。</p>
</blockquote>
<h2 id="方案及平台"><a href="#方案及平台" class="headerlink" title="方案及平台"></a>方案及平台</h2><p>github page<br>hexo<br>hexo主题: hexo-theme-next<br>nodejs: 12.18.3<br>npm: 6.14.6<br>安装包地址:<a target="_blank" rel="noopener" href="https://npm.taobao.org/dist">https://npm.taobao.org/dist</a><br><u>不建议通过apt-get 进行安装，版本太低，hexo有nodejs的版本要求</u><br>## github准备<br>在个人账号下新建仓库名为 <user-name>.github.io<br>## hexo安装<br>下载安装包，并解压到/opt，把路径下的，node，npm执行文件软链到/local/bin下<br>全局安装hexo <br><code>npm install -g hexo</code></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo init</span><br><span class="line">//本地运行</span><br><span class="line">hexo s</span><br></pre></td></tr></table></figure>
<p>打开localhost:4000查看效果<br>目录结构:</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">├── _config.yml</span><br><span class="line">├── package.json</span><br><span class="line">├── scaffolds</span><br><span class="line">├── source</span><br><span class="line"> |   ├── _drafts</span><br><span class="line"> |   └── _posts</span><br><span class="line">└── themes</span><br></pre></td></tr></table></figure>
<p>_config.yml文件用于存放网站的配置信息，你可以在此配置大部分的参数；<br>scaffolds是存放模板的文件夹，当新建文章时，Hexo会根据scaffold来建立文件；<br>source是资源文件夹，用于存放用户资源<br>themes是主题文件夹，存放博客主题，Hexo 会根据主题来生成静态页面。<br>### 通过 hexo-deployer-git 部署<br><u>(略)完成了主机的git配置，name/mail/ssh key 等等</u><br>编辑 _congif.yml</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"># Deployment</span><br><span class="line">## Docs: https://hexo.io/docs/deployment.html</span><br><span class="line">deploy:</span><br><span class="line">  type: git</span><br><span class="line">  repo: &lt;你的仓库地址&gt; # https://github.com/xxxx/xxxx.github.io</span><br><span class="line">  branch: master</span><br></pre></td></tr></table></figure>
<p><code> npm install hexo-deployer-git --save</code><br><code>hexo deploy</code><br>## 安装next主题<br>在blog根目录下 <br><code>git clone https://github.com/theme-next/hexo-theme-next themes/next</code><br>修改_config.yml<br><code>theme: next</code><br>其他 <br>美化方案 <a target="_blank" rel="noopener" href="https://blog.csdn.net/nightmare_dimple/article/details/86661502">https://blog.csdn.net/nightmare_dimple/article/details/86661502</a></p>
<h2 id="绑定域名"><a href="#绑定域名" class="headerlink" title="绑定域名"></a>绑定域名</h2><p>略</p>
<h2 id="坑"><a href="#坑" class="headerlink" title="坑"></a>坑</h2><ul>
<li>css无法加载（出现蓝底白字）<br>此处由于_config.yml里的url 或 url+root设置问题，导致不能找到资源 <br>修改为<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">url:  https://xxx.github.io</span><br><span class="line">root: /xxx.github.io</span><br></pre></td></tr></table></figure></li>
</ul>
<h2 id="hexo的使用"><a href="#hexo的使用" class="headerlink" title="hexo的使用"></a>hexo的使用</h2><p>未完待续</p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/waywardyux/tags/hexo/" rel="tag"># hexo</a>
              <a href="/waywardyux/tags/%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/" rel="tag"># 环境搭建</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item"></div>
      <div class="post-nav-item">
    <a href="/waywardyux/2021/03/20/%E6%8E%8C%E6%8E%A7%E8%87%AA%E5%B7%B1%E7%9A%84%E4%BB%A3%E7%A0%81/" rel="next" title="掌控自己的代码">
      掌控自己的代码 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E4%B9%8B%E8%B7%AF"><span class="nav-number">1.</span> <span class="nav-text">个人博客之路</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%96%B9%E6%A1%88%E5%8F%8A%E5%B9%B3%E5%8F%B0"><span class="nav-number">1.1.</span> <span class="nav-text">方案及平台</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%BB%91%E5%AE%9A%E5%9F%9F%E5%90%8D"><span class="nav-number">1.2.</span> <span class="nav-text">绑定域名</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%9D%91"><span class="nav-number">1.3.</span> <span class="nav-text">坑</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#hexo%E7%9A%84%E4%BD%BF%E7%94%A8"><span class="nav-number">1.4.</span> <span class="nav-text">hexo的使用</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="yux"
      src="/waywardyux/images/head.jpg">
  <p class="site-author-name" itemprop="name">yux</p>
  <div class="site-description" itemprop="description">虚假快乐小牛马</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/waywardyux/archives/">
        
          <span class="site-state-item-count">4</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/waywardyux/categories/">
          
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/waywardyux/tags/">
          
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/iyux" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;iyux" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:yux.scse@gmail.com" title="E-Mail → mailto:yux.scse@gmail.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">yux</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/waywardyux/lib/anime.min.js"></script>
  <script src="/waywardyux/lib/velocity/velocity.min.js"></script>
  <script src="/waywardyux/lib/velocity/velocity.ui.min.js"></script>

<script src="/waywardyux/js/utils.js"></script>

<script src="/waywardyux/js/motion.js"></script>


<script src="/waywardyux/js/schemes/pisces.js"></script>


<script src="/waywardyux/js/next-boot.js"></script>




  















  

  

</body>
</html>
